package botsavesprincess2;

import java.util.Scanner;

public class Solution {
	/* Head ends here */
	static void nextMove(int n, int x, int y, String [] board) {
		int pr = 0, pc = 0;
		for(int i = 0; i < n; i++) {
			int pi = board[i].indexOf('p');
			if(pi >= 0) {
				pr = i;
				pc = pi;
			}
		}
		if(pr < x)
			System.out.println("UP");
		else if(pr > x)
			System.out.println("DOWN");
		else if(pc < y)
			System.out.println("LEFT");
		else if(pc > y)
			System.out.println("RIGHT");
	}
	/* Tail starts here */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n,x,y;
		n = in.nextInt();
		x = in.nextInt();
		y = in.nextInt();
		in.useDelimiter("\r\n");
		String board[] = new String[n];

		for(int i = 0; i < n; i++) {
			board[i] = in.next();
		}
		in.close();
		nextMove(n,x,y,board);
	}
}
